<?php
// +----------------------------------------------------------------------
// | Yzncms [ 御宅男工作室 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://yzncms.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | fastadmin: https://www.fastadmin.net/
// +----------------------------------------------------------------------

// +----------------------------------------------------------------------
// | 手机短信接口
// +----------------------------------------------------------------------
namespace app\api\controller;

use app\admin\model\UserModel;
use app\api\model\Token;
use app\common\controller\Api;
use app\common\library\Sms as Smslib;
use app\common\model\AliPay;
use app\common\model\MemberModel;
use app\common\model\RebateLog;
use app\member\model\Member;
use think\facade\Hook;
use think\facade\Validate;
use think\Request;
use util\Http;

/**
 * @title 手机短信接口
 * @controller api\controller\Sms
 * @group base
 */
class My extends Api
{

    protected $noNeedLogin = [];


    /**
     * @title 获取用户信息
     *
     */
    public function getUserInfo(){
        $data = (new MemberModel())->getUserInfo($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }



    /**
     * @title 提交个人信息
     *
     */

    public function saveUserAuth(){
        $data = (new MemberModel())->saveUserAuth($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    /**
     * @title 获取用户提交的信息
     *
     */
    public function getUserAuth(){
        $data = (new MemberModel())->getUserAuth($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }

    /**
     * @title 获取用户收益列表
     *
     */
    public function getRebateList(){
        $data = (new RebateLog())->getList($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }

    /**
     * @title 提交支付宝信息
     *
     */
    public function saveAliPay(){
        $data = (new AliPay())->saveAliPay($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    /**
     * @title 删除支付宝信息
     *
     */
    public function delAlipay(){
        $data = (new AliPay())->delAlipay($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    /**
     * @title 获取支付宝信息
     *
     */
    public function getAliPay(){
        $data = (new AliPay())->getAliPay($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    /**
     * @title 退出登陆
     *
     */
    public function loginOut(){
        $data = (new MemberModel())->loginOut($this->request_array);
        $data['code'] == 200 ? $this->success($data['msg'],$data['data']) : $this->error($data['msg']);
    }






}
